package com.nuonuo.nuo_xp;

import android.util.Base64;

import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;

/**
 * @author glsite.com
 * @version $Rev$
 * @des ${TODO}
 * @updateAuthor $Author$
 * @updateDes ${TODO}
 */
public class DESede {
    private static String jiami_text="nuonuo";
    public static String get_desede() throws Exception {
        SecretKey secretKey = SecretKeyFactory.getInstance("DESede").generateSecret(new DESedeKeySpec("123456781234567812345678".getBytes()));
        Cipher cipher = Cipher.getInstance("DESede/ECB/PKCS5Padding");
        cipher.init(1, secretKey);
        cipher.update(jiami_text.getBytes());
        return Base64.encodeToString(cipher.doFinal("123456789".getBytes()), 0);
    }
}
